package org.example.designPattern.behavioral.chain;

import java.util.Iterator;
import java.util.List;

public class PngProcessor extends FileProcessor{
    public PngProcessor() {
    }

    public PngProcessor(FileProcessor nextFileProcessor) {
        super(nextFileProcessor);
    }

    @Override
    public void execute(List<String> urls) {
        System.out.println("=======PngProcessor========");
        Iterator<String> iterator = urls.iterator();
        if (iterator.hasNext()){
            String next = iterator.next();
            if(next.contains(".png")){
                System.out.println(next + "是png类型附件，进行处理");
            }
        }
    }
}
